package com.ygqh.baby.service;

import com.ygqh.baby.ao.CommissionStatus;
import com.ygqh.baby.ao.Message;
import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.ao.ResultSet;
import com.ygqh.baby.po.YgCommissionDetail;

import java.math.BigDecimal;
import java.util.List;

public interface YgCommissionDetailService {

	List<YgCommissionDetail> find();

	int findCount();

	YgCommissionDetail findById(Long id);

	int save(YgCommissionDetail ygCommissionDetail);

	int update(YgCommissionDetail ygCommissionDetail);

	int saveOrUpdate(YgCommissionDetail ygCommissionDetail);

	ResultSet<YgCommissionDetail> search(QueryInfo queryInfo, Long commissionId, String q);

	/**
	 * 旧版本接口（支持多次提现、部分提现。提现明细与返利明细一一对应）
	 * 
	 * @param commissionId
	 * @param commissionPrice
	 * @param userId
	 * @return
	 */
	Message addCommisssionDetail(Long commissionId, BigDecimal commissionPrice, Long userId);

	/**
	 * 
	 * @param userId
	 *            用户id
	 * @param commissionId
	 *            申请单id
	 * @param commissionPrice
	 *            申请单金额
	 * @param commissionStatus
	 *            申请单状态
	 * @param maxId 
	 * @return
	 * @throws Exception 
	 */
	int updateBalanceDetailByCommission(Long userId, Long commissionId, BigDecimal commissionPrice,
										CommissionStatus commissionStatus, Long maxId, String platformNo) throws Exception;

}
